<template>
	<view class="content">
		<!-- 开票结果 -->
		<view class="result-box">
			<!-- 成功图标 -->
			<view class="success-icon">
				<u-icon size="60" name="/static/success.png"></u-icon>
			</view>

			<!-- 结果文本 -->
			<view class="result-text">下单成功</view>

			<!-- 金额 -->
			<view class="amount">
				<text class="symbol">¥</text>
				<text class="number">{{ money || 0 }}</text>
			</view>

			<view class="buttons flex" style="margin-top: 60rpx;">
				<u-button type="primary" size="small" text="回到首页" @click="toHome"></u-button>
				<u-button type="primary" :customStyle="{marginLeft: '20rpx'}" :plain="true" size="small" text="返回" @click="back"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: 0, // 单位元
			}
		},
		onLoad({ money }) {
			this.money = money;
			// 设置导航栏
			uni.setNavigationBarTitle({
				title: '充值成功'
			})
		},
		methods: {
			toHome() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			back() {
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background-color: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 120rpx;
		font-family: 'PINGFANG';
	}

	.result-box {
		text-align: center;

		.success-icon {
			width: 160rpx;
			height: 160rpx;
			border-radius: 50%;
			display: flex;
			align-items: center;
			justify-content: center;
			margin: 0 auto 40rpx;
		}

		.result-text {
			font-size: 42rpx;
			font-weight: bold;
			color: #000000;
		}

		.amount {
			margin-top: 30rpx;

			.symbol {
				font-size: 50rpx;
				color: #FC0A01;
				margin-right: 10rpx;
			}

			.number {
				font-size: 60rpx;
				font-weight: bold;
				color: #FC0A01;
			}
		}

		.order-info {
			font-weight: 400;
			font-size: 26rpx;
			color: #AAAAAA;
		}
	}
</style>